import java.sql.Date;


public class RandomValues {
	public static String randomString(int length) {
		String sResult = "";
		char c = (char) ((Math.random() * 26) + 65);
		for (int i = 0; i < length; i++) {
			sResult += c;
		}
		return sResult;
	}
	
	public static int randomInt(int from, int to) {
		return (int) (((double) Math.random()) * ((double) (to-from+1)) + (double) from);
	}
	
	public static long randomLong(long from, long to) {
		return (long) (((double) Math.random()) * ((double) (to-from+1)) + (double) from);
	}
	
	public static double randomFloat(int from, int to, int decimals) {
		int result =(int) (((double) Math.random()) * ((double) (to-from+1) * (double) (10 * decimals)) + (double) from);
		return ((double) result) / ((double) (10 * decimals));
	}
	
	public static Date randomDate() {
		long back = 365 * 10 * 24 * 60 * 60 * 1000;
		return new Date(System.currentTimeMillis() - randomLong(0, back));
	}
}
